lst = [13,4,1,3]

# for i in lst:
#     print(i)
#

# print(lst[0])
# print(lst[:0:-1])
# print(len(lst))
lst.append('张三')
lst.append('张三2')

lst.insert(0,'张三3')
lst.extend(['张三4','张三4','张三5'])
# print(lst)

p = lst.pop(0)
# print(lst)
# print(p)

m = lst.remove('张三')
# print(lst)

lst[0] = '张三'
print(lst)

# for item in lst:
for i in range(0, len(lst)):
    item = lst[i]
    print('item:',item)
    if str(item).startswith('张'):
        # print(lst)
        new_name = item.replace('张','李')
        # print(new_name)
        new_name2 = '王'+item[1:]
        # print(new_name2)
        lst[lst.index(item)] = new_name
        # lst.insert(lst.index(new_name),new_name2)
        # print(lst)

print(lst)

temp = []
for item in lst:
    if str(item).startswith('李'):
        temp.append(item)
print(temp)
temp.remove('李三4')
print(temp)

print("==========")

for item in temp:
    print(item)
    lst.remove(item)
    print(lst)

print(lst)
# lst.reverse()
# print(lst)

# lst2 = [3,54,6,43,56]
# lst2.reverse()
# print(lst2)
# lst2.sort()
# print(lst2)
